package com.example.hasee.weather;

import com.example.hasee.data.DataCallback;
import com.example.hasee.data.DataStore;
import com.example.hasee.data.entity.Weather;

public class WeatherPresenter implements WeatherContract.Presenter{
    private WeatherContract.View rootView;
    private DataStore mDataStore;

    public WeatherPresenter(WeatherContract.View rootView) {
        this.rootView = rootView;
        mDataStore=DataStore.getINSTANCE();
    }

    @Override
    public void getWeatherInfo() {
        mDataStore.getWeatherInfo(new DataCallback<Weather>() {
            @Override
            public void onSuccess(Weather data) {
                rootView.weatherInfo(data);
            }
            @Override
            public void onFail(String message) {

            }
        });
    }
}
